
<extend name="Public:User/base"/>
<block name="content">
    <div class="my-cols-right info-back-color back-margin-padding col-sm-9 col-lg-9">
        <div class="row">
            <div class="small-search col-sm-12 col-lg-12">
                <!-- row-search start -->
                <div class="row">
                    <div class="small-search-a col-sm-6 col-lg-6 text-center">
                        <a class="collect-btn" href="{:U('Home/OrderInfo/bingo?type=0')}">全部拼购</a>
                        <a class="collect-btn" href="{:U('Home/OrderInfo/bingo?type=1')}">正在继续</a>
                        <a class="collect-btn" href="{:U('Home/OrderInfo/bingo?type=2')}">已揭晓</a>
                    </div>
                    <div class="col-sm-6 col-lg-6"></div>
                </div>
                <!--row-search end-->
            </div>
        </div>
        <div class="row"><br>
            <div class="my-select btn-group goods-status col-sm-3 col-lg-3">
                <button disabled type="button" class="btn down-select"  style="width:130px;">
                    <if condition="$Think.session.time eq 1">最近一个月
                        <elseif condition="$Think.session.time eq 3"/>最近三个月
                        <elseif condition="$Think.session.time eq 6"/>最近半年
                        <elseif condition="$Think.session.time eq 12"/>最近一年
                        <else/>全部
                    </if>
                </button>
                <button type="button" class="btn down-select dropdown-toggle" data-toggle="dropdown">
                    <span class="caret"></span>
                    <span class="sr-only">切换下拉菜单</span>
                </button>
                <ul class="dropdown-menu" role="menu" id="ulid">
                    <li><a href="{:U('Home/OrderInfo/bingo?time=1')}">最近一个月</a></li>
                    <li><a href="{:U('Home/OrderInfo/bingo?time=3')}">最近三个月</a></li>
                    <li><a href="{:U('Home/OrderInfo/bingo?time=6')}">最近半年</a></li>
                    <li><a href="{:U('Home/OrderInfo/bingo?time=12')}">最近一年</a></li>
                    <li class="divider"></li>
                    <li><a href="{:U('Home/OrderInfo/bingo?time=1000')}">全部</a></li>
                </ul>
            </div>

            <div class="col-sm-offset-2 col-lg-offset-2 col-sm-5 col-lg-5" role="form">
                <form action="__SELF__" method="post" name="search" role="search">
                    <div class="input-group"  style="margin-top: -10px;">
                        <label class="sr-only"></label><!--form表单中，label标签必不可少-->
                        <input type="text" maxlength="255" autocomplete="off" class="form-control" placeholder="搜索拼购" name="search">
                        <span class="input-group-btn"><button type="submit" class="btn my-btn-default-text btn-default"><i class="icon-search" style="font-size: 18px;"></i></button></span>
                    </div>
                </form>
            </div><!--搜索框表单-->
            <div class="col-sm-2 col-lg-2"></div>
        </div>
        <!-- table star -->
        <div class="row"  style="margin-left: 30px;">
            <div class="col-sm-12 col-lg-12">
                <div class="mypanel panel panel-default text-center" style="border: none;">
                    <table>
                        <thead>
                        <empty name="bingoInfo">
                            没有符合条件的订单
                            <else/>
                            <tr class="table-title">
                                <td colspan="2">商品信息</td>
                                <td>金额（元）</td>
                                <td>状态</td>
                                <td>我的拼购码</td>
                                <td>参与时间</td>
                                <td>操作</td>
                            </tr>
                        </empty>

                        </thead>
                        <!--{foreach $orderInfo as $k=>$v}-->
                        <foreach name="bingoInfo" item="v">
                            <!--{foreach name='orderInfo' item='v'}-->
                            <tr class="black-row">
                                <td colspan="7"></td>
                            </tr>
                            <!--{foreach name="orderInfo" item="v"}-->
                            <tr class="table-row">
                                <td><img src="{$Think.const.IMG_URL}/personalcenter/smart_img.png" height="135" width="130"></td>
                                <td>
                                    <a href="#商品名">{$v['goodsname']}</a><br>
                                    <!--<a href="#商品型号">这个是商品型号</a>-->
                                </td>

                                <td> {$v['joinprice']}</td>
                                <td>{$v['number']}/{$v['total']}</td>
                                <td>{$v['lotterynumber']}</td>
                                <td>{$v.joindate}</td>
                                <td>
                                    <if condition="($v['iswin'] eq 1) AND ($v['isreceive'] eq 0)">
                                        <P><button type="button" class="btn button-set btn-primary" data-toggle="modal" data-target="#myModal">
                                            领取
                                        </button></P>
                                    </if>
                                    <if condition="($v.isShare eq 1) AND ($v['iswin'] eq 1)  AND ($v['isreceive'] eq 1)">
                                        <P><button type="button" class="btn button-set btn-primary"
                                                   onclick="window.location.href ='{:U('Home/Share/editShare?userlotterId='.$v['userlotterid'])}' ">
                                            分享
                                        </button></P>
                                    </if>
                                    <if condition="($v.isShare eq 2) AND ($v['iswin'] eq 1)  AND ($v['isreceive'] eq 1)">
                                        <P><button type="button" class="btn button-set btn-primary" data-toggle="modal" data-target="#myModal">
                                            已分享
                                        </button></P>
                                    </if>
                                    <div class="btn button-set">查看</div>
                                </td>
                            </tr>
                        </foreach>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
        <!-- table end -->
    </div>
    <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
        <div class="modal-dialog" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                    <h4 class="modal-title" id="myModalLabel">填写领取信息</h4>
                </div>
                <form class="container-fluid form-horizontal" action="__MODULE__/OrderInfo/addOrderInfo" method="POST">
                    <div class="modal-body text-left">
                        <form class="form-horizontal">
                            <div class="row">
                                <foreach name="AddressInfo" item="addressInfo">
                                <div class="radio">
                                    <label class="h4">
                                        <if condition="$addressInfo.isdefault eq 1">
                                            <!--如果是已存在的地址，则value值为遍历的id值，否则为0-->
                                        <input type="radio" name="optionsRadios" id="optionsRadios" value="2" checked>
                                        <else/>
                                        <input type="radio" name="optionsRadios" id="optionsRadios" value="2">
                                        </if>
                                        {$addressInfo.consignee} {$addressInfo.address} {$addressInfo.zipcode} {$addressInfo.contactphone}
                                    </label>
                                </div>
                                </foreach>
                            </div>
                            <label class="h3">使用新地址：</label>
                            <input type="hidden" name="userLotterId" value="6"}>
                            <input type="hidden" name="goods_ID" value="34"}>
                            <input type="hidden" name="unitPrice" value="10"}>
                            <div class="form-group">
                                <label class="col-sm-3 col-lg-3 control-label">详细地址</label>
                                <div class="col-sm-offset-1 col-lg-offset-1 col-sm-8 col-lg-8">
                                    <input type="text" name="address">
                                </div>
                            </div>

                            <div class="form-group">
                                <label class="col-sm-3 col-lg-3 control-label">邮政编码</label>
                                <div class="col-sm-offset-1 col-lg-offset-1 col-sm-8 col-lg-8">
                                    <input type="text" name="zipCode">
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 col-lg-3 control-label">收件人姓名</label>
                                <div class="col-sm-offset-1 col-lg-offset-1 col-sm-8 col-lg-8">
                                    <input type="text" name="consignee">
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 col-lg-3 control-label">手机号码</label>
                                <div class="col-sm-offset-1 col-lg-offset-1 col-sm-8 col-lg-8">
                                    <input type="text" name="contactPhone">
                                </div>
                            </div>


                            <div class="modal-footer">
                                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                                <button type="submit" class="btn btn-primary">确认填写</button>
                            </div>
                        </form>
                    </div>
                </form>
            </div>
        </div>
    </div>
</block>
